<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>传智健康</title>
    <meta name="description" content="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>健康评估<small>中医体质辨识</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>健康评估</el-breadcrumb-item>
            <el-breadcrumb-item>中医体质辨识</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
                <el-table-column type="index" align="center" label="序号"></el-table-column>
                <el-table-column prop="name" label="体质名称" align="center"></el-table-column>
                <el-table-column prop="remark" label="特征" align="center"></el-table-column>
                <el-table-column prop="nursing" label="调养方式" align="center"></el-table-column>
            </el-table>
            <div class="pagination-container">
                <el-pagination
                        class="pagiantion"
                        @current-change="handleCurrentChange"
                        :current-page="pagination.currentPage"
                        :page-size="pagination.pageSize"
                        layout="total, prev, pager, next, jumper"
                        :total="pagination.total">
                </el-pagination>
            </div>



        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data:{
            pagination: {//分页相关模型数据
                currentPage: 1,//当前页码
                pageSize:10,//每页显示的记录数
                total:0,//总记录数
                queryString:null//查询条件
            },
            dataList: [],//当前页要展示的分页列表数据
           // formData: {},//表单数据


        },
        //钩子函数，VUE对象初始化完成后自动执行
        created() {
            this.findPage()
        },
        methods: {
            //分页查询
            findPage() {
                axios.get("/user/findPhysical",{params:this.pagination}).then(resp=>{
                    //处理响应结果
                    if(resp.data.flag){
                        //查到了结果
                        // this.$message.success(resp.data.message);
                        //展示表格数据
                        this.dataList=resp.data.data.rows;
                        //展示分页条数据
                        this.pagination.total=resp.data.data.total;
                    }else{
                        this.$message.error(resp.data.message);
                    }
                }).catch(error => {
                    // alert(error);
                    // alert(error.message);
                    this.showMessage(error);
                })
            },

            showMessage(r) {//权限不足提示
                if (r == 'Error: Request failed with status code 403') {
                    //权限不足
                    // this.$message.error('无访问权限');
                    window.location.href="/error_403.html";
                    return;
                } else {
                    this.$message.error('未知错误');
                    return;
                }
            },






        }
    })
</script>
</html>